Validator<'E>Type
PackageFCQRS.Model
Specification
Kind
Type
Members
41
Examples
0
``.ctor``Signature
Validator(all)
DefaultOfErrorSignature
this.DefaultOfError
DefaultOfNoneSignature
this.DefaultOfNone
EndSignature
this.End
EndAsyncSignature
this.EndAsync
Summary
| Name | Signature | Synopsis |
|---|---|---|
| ``.ctor`` | Validator(all) | No description available. |
| DefaultOfError | this.DefaultOfError | Defaults of Error value, it won't collect error |
| DefaultOfNone | this.DefaultOfNone | Defaults of None value, it won't collect error |
| End | this.End | No description available. |
| EndAsync | this.EndAsync | No description available. |
| Enum | this.Enum | No description available. |
| Gt | this.Gt | Greater then a value, if err is a string, it can contains `{min}` to reuse first param |
| Gte | this.Gte | Greater and equal then a value, if err is a string, it can contains `{min}` to reuse first param |
| IsDigit | this.IsDigit | No description available. |
| IsMail | this.IsMail | No description available. |
| IsOk | this.IsOk | Test a Result value is Ok and unwrap it it will collect error |
| IsSome | this.IsSome | Test an option value is some and unwrap it it will collect error |
| IsUrl | this.IsUrl | No description available. |
| IsValid | this.IsValid | Validate with a custom tester, return bool |
| IsValidAsync | this.IsValidAsync | No description available. |
| IsValidOpt | this.IsValidOpt | Validate with a custom tester, return ValidateResult DU to modify input value |
| IsValidOptAsync | this.IsValidOptAsync | No description available. |
| Lt | this.Lt | Less then a value, if err is a string, it can contains `{max}` to reuse first param |
| Lte | this.Lte | Less and equal then a value, if err is a string, it can contains `{max}` to reuse first param |
| Map | this.Map | Map a function or constructor to the value, aka lift fn shouldn't throw error, if it would, please using `t.To fn error` |
| Match | this.Match | No description available. |
| MaxLen | this.MaxLen | Max length, if err is a string, it can contains `{len}` to reuse first param |
| MinLen | this.MinLen | Min length, if err is a string, it can contains `{len}` to reuse first param |
| NotBlank | this.NotBlank | Validate with `String.IsNullOrWhiteSpace` |
| PushError | this.PushError | No description available. |
| Test | this.Test | No description available. |
| TestAsync | this.TestAsync | No description available. |
| TestOne | this.TestOne | No description available. |
| TestOneOnlyOk | this.TestOneOnlyOk | No description available. |
| TestOneOnlyOkAsync | this.TestOneOnlyOkAsync | No description available. |
| TestOneOnlySome | this.TestOneOnlySome | No description available. |
| TestOneOnlySomeAsync | this.TestOneOnlySomeAsync | No description available. |
| TestOnlyOk | this.TestOnlyOk | Test rules only if value is Ok, it won't collect error if value is Error |
| TestOnlyOkAsync | this.TestOnlyOkAsync | Test rules only if value is Ok, it won't collect error if value is Error |
| TestOnlySome | this.TestOnlySome | Test rules only if value is Some, it won't collect error if value is None |
| TestOnlySomeAsync | this.TestOnlySomeAsync | Test rules only if value is Some, it won't collect error if value is None |
| To | this.To | Convert the input value by fn if fn throws error then it will collect error |
| ToAsync | this.ToAsync | Convert a synchronize validate pipe to asynchronize |
| Trim | this.Trim | No description available. |
| Errors | this.Errors | No description available. |
| HasError | this.HasError | No description available. |
Defaults of Error value, it won't collect error
Parameters
| Name | Type | Description |
|---|---|---|
| defaults | 'T0 | |
| input | FieldInfo<'T, Result<'T0, 'TError>, 'E> |
Returns
FieldInfo<'T, 'T0, 'E>
Defaults of None value, it won't collect error
Parameters
| Name | Type | Description |
|---|---|---|
| defaults | 'T0 | |
| input | FieldInfo<'T, 'T0 option, 'E> |
Returns
FieldInfo<'T, 'T0, 'E>
Parameters
| Name | Type | Description |
|---|---|---|
| input | Async<FieldInfo<'T, 'T0, 'E>> |
Returns
Async<'T0>
Parameters
| Name | Type | Description |
|---|---|---|
| enums | 'T0 list |
Returns
'E -> FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T0, 'E>
Greater then a value, if err is a string, it can contains `{min}` to reuse first param
Parameters
| Name | Type | Description |
|---|---|---|
| min | 'a | |
| err | 'E |
Returns
FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>
Greater and equal then a value, if err is a string, it can contains `{min}` to reuse first param
Parameters
| Name | Type | Description |
|---|---|---|
| min | 'a | |
| err | 'E |
Returns
FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>
Parameters
| Name | Type | Description |
|---|---|---|
| error | 'E | |
| input | FieldInfo<'T, string, 'E> |
Returns
FieldInfo<'T, string, 'E>
Parameters
| Name | Type | Description |
|---|---|---|
| error | 'E | |
| input | FieldInfo<'T, string, 'E> |
Returns
FieldInfo<'T, string, 'E>
Test a Result value is Ok and unwrap it
it will collect error
Parameters
| Name | Type | Description |
|---|---|---|
| error | 'E |
Returns
FieldInfo<'T, Result<'T0, 'TError>, 'E> -> FieldInfo<'T, 'T0, 'E>
Test an option value is some and unwrap it
it will collect error
Parameters
| Name | Type | Description |
|---|---|---|
| error | 'E |
Returns
FieldInfo<'T, 'T0 option, 'E> -> FieldInfo<'T, 'T0, 'E>
Parameters
| Name | Type | Description |
|---|---|---|
| error | 'E | |
| input | FieldInfo<'T, string, 'E> |
Returns
FieldInfo<'T, string, 'E>
Validate with a custom tester, return bool
Parameters
| Name | Type | Description |
|---|---|---|
| tester | 'T0 -> bool |
Returns
'E -> FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T0, 'E>
Parameters
| Name | Type | Description |
|---|---|---|
| tester | 'T0 -> Async<bool> |
Returns
'E -> Async<FieldInfo<'T, 'T0, 'E>> -> Async<FieldInfo<'T, 'T0, 'E>>
Validate with a custom tester, return ValidateResult DU to modify input value
Parameters
| Name | Type | Description |
|---|---|---|
| tester | 'T0 -> ValidateResult<'T1> | |
| error | 'E | |
| input | FieldInfo<'T, 'T0, 'E> |
Returns
FieldInfo<'T, 'T1, 'E>
Parameters
| Name | Type | Description |
|---|---|---|
| tester | 'T0 -> Async<ValidateResult<'T1>> | |
| error | 'E | |
| input | Async<FieldInfo<'T, 'T0, 'E>> |
Returns
Async<FieldInfo<'T, 'T1, 'E>>
Less then a value, if err is a string, it can contains `{max}` to reuse first param
Parameters
| Name | Type | Description |
|---|---|---|
| max | 'a | |
| err | 'E |
Returns
FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>
Less and equal then a value, if err is a string, it can contains `{max}` to reuse first param
Parameters
| Name | Type | Description |
|---|---|---|
| max | 'a | |
| err | 'E |
Returns
FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>
Map a function or constructor to the value, aka lift
fn shouldn't throw error, if it would, please using `t.To fn error`
Parameters
| Name | Type | Description |
|---|---|---|
| fn | 'T0 -> 'T1 |
Returns
FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T1, 'E>
Parameters
| Name | Type | Description |
|---|---|---|
| regex | Regex | |
| error | 'E | |
| input | FieldInfo<'T, string, 'E> |
Returns
FieldInfo<'T, string, 'E>
Max length, if err is a string, it can contains `{len}` to reuse first param
Parameters
| Name | Type | Description |
|---|---|---|
| len | int | |
| err | 'E | |
| input | FieldInfo<'T, 'T0, 'E> |
Returns
FieldInfo<'T, 'T0, 'E>
Min length, if err is a string, it can contains `{len}` to reuse first param
Parameters
| Name | Type | Description |
|---|---|---|
| len | int | |
| err | 'E | |
| input | FieldInfo<'T, 'T0, 'E> |
Returns
FieldInfo<'T, 'T0, 'E>
Validate with `String.IsNullOrWhiteSpace`
Parameters
| Name | Type | Description |
|---|---|---|
| err | 'E |
Returns
FieldInfo<'T, string, 'E> -> FieldInfo<'T, string, 'E>
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| value | 'T |
Returns
Async<FieldInfo<'T, 'T, 'E>>
Parameters
| Name | Type | Description |
|---|---|---|
| value | Result<'T, 'TError> |
Returns
(FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list -> Result<'T, 'TError>
Parameters
| Name | Type | Description |
|---|---|---|
| value | Result<'T, 'TError> |
Returns
(Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list -> Async<Result<'T, 'TError>>
Parameters
| Name | Type | Description |
|---|---|---|
| value | 'T option |
Returns
(FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list -> 'T option
Parameters
| Name | Type | Description |
|---|---|---|
| value | 'T option |
Returns
(Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list -> Async<'T option>
Test rules only if value is Ok,
it won't collect error if value is Error
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| value | Result<'T, 'TError> | |
| rules | (FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list |
Returns
Result<'T, 'TError>
Test rules only if value is Ok,
it won't collect error if value is Error
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| value | Result<'T, 'TError> | |
| rules | (Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list |
Returns
Async<Result<'T, 'TError>>
Test rules only if value is Some,
it won't collect error if value is None
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| value | 'T option | |
| rules | (FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list |
Returns
'T option
Test rules only if value is Some,
it won't collect error if value is None
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| value | 'T option | |
| rules | (Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list |
Returns
Async<'T option>
Convert the input value by fn
if fn throws error then it will collect error
Parameters
| Name | Type | Description |
|---|---|---|
| fn | 'T0 -> 'T1 |
Returns
'E -> FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T1, 'E>
Convert a synchronize validate pipe to asynchronize
Parameters
| Name | Type | Description |
|---|---|---|
| input | FieldInfo<'T, 'T0, 'E> |
Returns
Async<FieldInfo<'T, 'T0, 'E>>
Parameters
| Name | Type | Description |
|---|---|---|
| input | FieldInfo<'T, string, string> |
Returns
FieldInfo<'T, string, string>